package com.ry.day1129;

import java.util.*;

//本题可以用二进制，还没搞懂呢，先用hash解决
public class LC84 {

    static class Solution {

        /**
         * @param a: An integer array
         * @return: An integer array we will sort your return value in output
         */
        public List<Integer> singleNumberIII(int[] a) {
            Set<Integer> set = new HashSet<>();
            for (int v : a) {
                if (set.contains(v)) {
                    set.remove(v);
                } else {
                    set.add(v);
                }

            }
            return new ArrayList<>(set);
        }

    }

    public static void main(String[] args) {
    }
}
